﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BitPortal.Business;

namespace BitPortal.Modules
{
    public partial class QuickSearch : Controls.BaseUserControl
    {
        public bool EnabledAutocomplete = true;
        public bool SearchProduct = true;
        public bool SearchArticle = true;
        public bool SearchMedia = true;
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected override void OnInit(EventArgs e)
        {
            EnabledAutocomplete = (bool)PortalConfigBLL.GetValueByName("QuickSearch.EnableAutocomlete");
            SearchProduct = (bool)PortalConfigBLL.GetValueByName("QuickSearch.SearchProduct");
            SearchArticle = (bool)PortalConfigBLL.GetValueByName("QuickSearch.SearchArticle");
            SearchMedia = (bool)PortalConfigBLL.GetValueByName("QuickSearch.SearchMedia");
            if (EnabledAutocomplete)
            {
                (this.Page as Controls.BaseFrontendPage).IncludeCssFile("/jquery-ui.custom/css/smoothness/jquery-ui-1.8.16.custom.css");
                (this.Page as Controls.BaseFrontendPage).IncludeScriptFile("/jquery-ui.custom/js/jquery-ui-1.8.16.custom.min.js");
            }
            base.OnInit(e);
            string key = Request.QueryString["key"];
            if (!string.IsNullOrEmpty(key))
            {
                tbAuto.Text = key;
            }
        }

    }
}